package lijun;

public class test4 {
    public static void main(String[] args) {
        Person person = null;
        try {
            person = new Person("郭靖", "男", 20);
            System.out.println(person);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        Person person1 = null;
        try {
            person1 = new Student("黄蓉", "女", 17, "1263001");
            System.out.println(person1);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        Person person2 = null;
        try {
            person2 = new Undergraduate("黄飞鸿", "男", 23, "1892001", "中国武术学");
            System.out.println(person2);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        Person person3 = null;
        try {
            person3 = new Undergraduate("韦小宝", "男", 300, "1892001", "中国武术学");
            System.out.println(person3);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
}
